/*	$Id: player.h 89 2007-01-05 03:21:25Z phrakt $	*/
/*
 * Copyright (c) 2006 Jean-Francois Brousseau <phrakt@gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _MTG_PLAYER_H_
#define _MTG_PLAYER_H_

#include <dominia/queue.h>

#include <mtg/mana.h>

#define MTG_PLAYER_INITLIFE		20
#define MTG_PLAYER_MAXPOISON		10


typedef struct mtg_player {
	char     *mp_name;

	int       mp_flags;

	int       mp_life;
	int       mp_poison;		/* poison counter */

	struct mtg_deck     *mp_deck;	/* player's current deck */
	struct mtg_manapool  mp_pool;

	struct mtg_game     *mp_game;	/* current game */

	LIST_ENTRY(mtg_player) mp_link;
} mtg_player_t;


mtg_player_t* mtg_player_create  (void);
void          mtg_player_free    (mtg_player_t *);
int           mtg_player_init    (mtg_player_t *);
int           mtg_player_getlife (const mtg_player_t *);
const char*   mtg_player_getname (const mtg_player_t *);
void          mtg_player_setlife (mtg_player_t *, int);
int           mtg_player_setname (mtg_player_t *, const char *);



#endif	/* _MTG_PLAYER_H_ */
